package com.tuo51.evaluate.domain.evaluatingV2;

import com.aliyun.openservices.shade.org.apache.commons.lang3.builder.HashCodeExclude;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.starinside.wp.domain.Domain;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.List;

/**
 * 选项的详情
 */

@Data
@Entity
@Table(name = "tb_evaluate_question")
@EqualsAndHashCode(callSuper = false)
public class EvaluateV2Question extends Domain {

    @Column(columnDefinition = "int default 0 COMMENT '月龄'")
    private Integer month = 0;

    @Column(columnDefinition = "int default '0' COMMENT '纸上序号'")
    private Integer indexOnPaper;

    @Column(columnDefinition = "int COMMENT '题目分组'")
    private Integer optionGroup;

    @Column(columnDefinition = "varchar(50) COMMENT '分组答案时的标题' ")
    private String optionTitle;

    @Column(columnDefinition = "int default '0' COMMENT '不通过短路序号'")
    private Integer shortIndex;

    @Column(columnDefinition = " bit DEFAULT 0 COMMENT '充分操作。 0：否，1是' ")
    private Boolean asPossibleAs = false;

    @Column(columnDefinition = " varchar(50) COMMENT '充分操作提示。' ")
    private String asPossibleAsTips;

    @Column(columnDefinition = "varchar(50) COMMENT '测评题目' ")
    private String title;

    @Column(columnDefinition = "varchar(500) COMMENT '问题详情，操作方法，步骤' ")
    private String detail;

    @Column(columnDefinition = "varchar(255) COMMENT '指导视频' ")
    private String guideVideo;

    @Column(columnDefinition = "varchar(255) COMMENT '指导视频封面' ")
    private String guideVideoCover;

    @Column(columnDefinition = "varchar(500) COMMENT '操作方法' ")
    private String operationGuide;

    @Column(columnDefinition = "varchar(500) COMMENT '通过标准' ")
    private String passingCriteria;

    @Column(columnDefinition = " bit DEFAULT 0 COMMENT '是否询问家长。 0：否，1是' ")
    private Boolean parentAnswer = false;

    //维度评分
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "question")
    @HashCodeExclude
    private List<EvaluateV2Tool> tools;

    @Column(columnDefinition = "varchar(32) COMMENT '单元的id'")
    private String itemId;

    @ManyToOne
    @JoinColumn(name = "itemId", columnDefinition = "varchar(32) default '' COMMENT '测评单元的id'", insertable = false, updatable = false)
    @JsonIgnore
    @HashCodeExclude
    private EvaluateV2Item item;

    @Transient
    private List options;

    @Transient
    private Boolean checked = null;

}
